//
//  ZHDBHelper.h
//  VehicleInsuranceSupport
//
//  Created by TangBin on 2019/11/4.
//  Copyright © 2019 TangBin. All rights reserved.
//

#import <Foundation/Foundation.h>
//#import <FMDB.h>
#import "ZHDBConstants.h"

NS_ASSUME_NONNULL_BEGIN

@interface ZHDBHelper : NSObject

+ (FMDatabaseQueue *)databaseQueue;

/// 判断表是否存在
/// @param tableName 表名
/// @param db db
+ (BOOL)isTableExist:(NSString *)tableName withDB:(FMDatabase *)db;

/// 创建表
/// @param sql sql
/// @param tableName 表名
+ (void)createTable:(NSString *)sql tableName:(NSString *)tableName;

/// 删除表
/// @param tableName 表名
+ (void)dropTableName:(NSString *)tableName;

/// 修改表结构
/// @param sql sql
/// @param tableName tableName description
+ (void)alterTableData:(NSString *)sql tableName:(NSString *)tableName;

/// 删除表数据
/// @param sql sql
/// @param tableName 表名
+ (void)deleteTableData:(NSString *)sql tableName:(NSString *)tableName;

/// 更新/添加数据数据
/// @param sql sql description
+ (void)updateExecuteSql:(NSString *)sql;

+ (void)querySql:(NSString *)sql resultSetBlock:(void(^)(FMResultSet *rs))resultSetBlock;

@end

NS_ASSUME_NONNULL_END
